<template>
  <actionBar :tray="false" :noTop="true" suffix="_child"></actionBar>
  <div>首页</div>
  <button @click="getToken">token</button>
  <button @click="getLogin">登录</button>

  <el-button type="primary" >Primary</el-button>

  <div>{{ userStore.token}}</div>
</template>
<script>
import {ref,unref, getCurrentInstance, watch, reactive, onMounted} from "vue";
import {ElMessage, ElMessageBox} from 'element-plus';
import {useRouter} from "vue-router";
import { useUserStore } from '@store/modules/useUserStore'
import actionBar from "@renderer/components/actionBar/index.vue";

export default {
  name: "index",
  props:["info"],
  emits:["update:info"],
  components:{
    actionBar
  },
  setup(props ,content){
    const router = useRouter()
    const {proxy} = getCurrentInstance();
    const userStore = useUserStore()
    let data = {

    }
    //监听
    watch(() => [props.info], ([newInfo],[oldInfo]) => {
      // if (newInfo){
      //   Object.assign(data.form, newInfo)
      // content.emit('update:info',newInfo)
      // }
    })
    onMounted(async () => {

    })
    let methods = {

    }

    return {
      proxy,
      router,
      userStore,
      ...data,
      ...methods
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
